k nearest neighbor Python Code